##################################################################
# PyngFM is a Python implementation of Ping.fm API.
#
# Version: 1.0
# Author: Andrea Grandi <a _DOT_ grandi _AT_ gmail _DOT_ com>
# License: GPL2
# Website: http://pyngfm.googlecode.com
#
# Note: this code is inspired to PHPingFM project.
##################################################################


class Trigger():
    def __init__(self, id=None, method=None, services=[]):
        self.__id = id
        self.__method = method
        self.__services = services
        
    @property
    def id(self):
        return self.__id
    
    @property
    def method(self):
        return self.__method
    
    @property
    def services(self):
        return self.__services

    def set_id(self, id):
        self.__id = id
        
    def set_method(self, method):
        self.__method = method
        
    def add_service(self, service_id, service_name):
        service = {'id': service_id, 'name': service_name}
        self.__services.append(service)
